<template>
  <div>
    <div class="sea">
      <img src="../../../static/index/bookssea.jpg" alt="">
      <p>书海淘金</p>
    </div>
    <No-select></No-select>
  </div>
</template>
<script>
import NoSelect from '../../components/noselectbuylists/index.vue'
export default {
  components: {
    NoSelect
  },
mounted() { 
    let pages = getCurrentPages() //获取加载的页面
    let currentPage = pages[pages.length-1] //获取当前页面的对象
    let url = currentPage.route //当前页面url
    let options = currentPage.options //如果要获取url中所带的参数可以查看options
    console.log('五元专区获取到id本应该接收到书单信息进行请求书单列表循环输出 前接口是单本书')
    console.log(options)
    // parentid === 0 的话代表是一级目录跳转来的
    if (options.parentid !== undefined && options.parentid === '0') {
        this.$http
            .post('/book/alllevel1', { //首页单品推荐
                headerUserToken: "wx-08db1ce041d943d0acd52bd8ab8b4e63",
                levelId: options.id,
                page:1,
                pageSize: 10  
            })
            .then(res => {
                console.log('一级类目类目详细信息')
                console.log('数据为空不渲染页面')
                console.log(res)
              wx.setStorageSync('headerUserToken', res.data)
            })
    }


}
  
}
</script>
<style lang="scss" scoped>
.sea {
  width: 100%;
  height: 362rpx;
  position: relative;
  img {
    width: 100%;
    height: 100%;
  }
  p {
    font-size: 72rpx;
    font-weight: 700;
    color: #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
</style>
